﻿@{
    Layout = "../Shared/_MobileLayout.cshtml";
}
@using Kevin.Shop.Business.Service.Entity.Helper;
@model List<RiderShop.Mobile.ServiceEntity.MyAccount.UserShipingAddressExtend>
@section header
{
    <style>
        .myAccountActive {
            color: #ff6c1f;
        }

        .tb-cell {
            display: table-cell;
            vertical-align: middle;
            font-weight: normal;
        }

        .well {
            padding: 10px 10px 0 10px;
            margin-bottom: 10px;
        }

        .addLine {
            width: 100%;
            margin-bottom: 0px;
        }

        footer {
            display: none;
        }
    </style>

}
@section title
{
    选择自提点
}
@section pagetitle
{
    选择自提点
}
<div class="userCenterHeader">
    <span class="iconWrapper">
        <img src="~/Themes/RongJi/Style/base/imgs/icon_zhi.png">
    </span>
    <h3>选择自提点</h3>
    <br class="clearfix">
</div>
<div class="box">
    <a href="/Purchase/ZiTiDianMap"><input type="button" class="btn btn-block" value="从地图选择"></a>
    @foreach (var item in Model.Count > 10 ? Model.Take(10) : Model)
    {
        <div class="well address-box mt10">
            <a href="/Purchase/Checkout?zitidian=@item.ShipTo&index=@item.ShippingId">
                <div class="tb-cell" style="width:100%">
                    <label class="addLine" sid="@item.ShippingId">

                        <div class="tb-cell">

                            <p class="font-xl">
                                @item.ShipTo&nbsp;@item.CellPhone&nbsp;
                            </p>
                            <p class="font-m">
                                @item.RegionAddress
                            </p>
                            <p class="font-m">
                                @Html.Raw(@item.Address)
                            </p>

                            <p class="font-m">
                                @if (!string.IsNullOrEmpty(WebClientContext.Current.CurrentUser.PickUpAddress) && WebClientContext.Current.CurrentUser.PickUpAddress.Contains(item.ShippingId.ToString()))
                                {
                                    <span class="green">
                                        @Html.Raw("最近使用&nbsp; &nbsp;")
                                    </span>
                                }

                                @if (item.Distance > 0)
                                {
                                    if (!string.IsNullOrEmpty(Request.QueryString["lng"]))
                                    {
                                        <span class="red">
                                            @Html.Raw("距离您当前位置约 " + (item.Distance / 1000).ToString("N1") + " 千米")
                                        </span>
                                    }
                                    else
                                    {
                                        <span class="red">
                                            @Html.Raw("距离您收货地址约 " + (item.Distance / 1000).ToString("N1") + " 千米")
                                        </span>
                                    }
                                }
                            </p>
                        </div>
                    </label>
                </div>
                <div class="tb-cell">
                    <div style="display:block;width:80px;">
                        <span class="glyphicon glyphicon-chevron-right f25 fr p0_10"></span>
                    </div>
                </div>
            </a>
        </div>
    }

</div>
@section footer
{

    <script type="text/javascript">

        //让toolbar选中
        var $homeImg = $("#homeImg");
        var $categoryImg = $("#categoryImg");
        var $myaccountImg = $("#myaccountImg");
        var $searchImg = $("#searchImg");

        $homeImg.attr("src", "/Themes/RongJi/Style/base/imgs/f10.png");
        $categoryImg.attr("src", "/Themes/RongJi/Style/base/imgs/f2.png");
        $myaccountImg.attr("src", "/Themes/RongJi/Style/base/imgs/f3_c.png");
        $searchImg.attr("src", "/Themes/RongJi/Style/base/imgs/f4.png");
    </script>
}